home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat3 / fwrite.3 < prev    next >
Encoding:
Text File  |  1993-03-03  |  2.1 KB  |  67 lines

  1.  
  2.  
  3.  
  4. FREAD(3)            MINTLIB LIBRARY FUNCTIONS            FREAD(3)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        fread, fwrite - buffered binary input/output
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        #include <stdio.h>
  12.  
  13.        size_t fread (void *ptr, size_t size, size_t nitems,
  14.                      FILE *stream);
  15.  
  16.        size_t fwrite (const void *ptr, size_t size, size_t nitems,
  17.                       FILE *stream);
  18.  
  19. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  20.        fread  reads, into a block pointed to by ptr, nitems items
  21.        of data from the named input stream stream, where an  item
  22.        of data is a sequence of bytes (not necessarily terminated
  23.        by a null byte) of length size. It returns the  number  of
  24.        items actually read. fread stops reading if an end-of-file
  25.        or error  condition  is  encountered  while  reading  from
  26.        stream,  or  if  nitems items have been read. fread leaves
  27.        the file pointer in stream, if defined,  pointing  to  the
  28.        byte follow- ing the last byte read if there is one. fread
  29.        does not change the contents of the file  referred  to  by
  30.        stream.
  31.  
  32.        fwrite  writes at most nitems items of data from the block
  33.        pointed to by ptr to the named output  stream  stream.  It
  34.        returns the number of items actually written. fwrite stops
  35.        writing when it has written nitems items of data or if  an
  36.        error  condition is encountered on stream. fwrite does not
  37.        change the contents of the block pointed to by ptr.
  38.  
  39.        If size or nitems is non-positive, no characters are  read
  40.        or written and 0 is returned by both fread and fwrite.
  41.  
  42. R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
  43.        fread  and  fwrite  return  the number of elements read on
  44.        success, 0 on failure.
  45.  
  46. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  47.        r✓re✓ea✓ad✓d(✓(3✓3)✓),✓, w✓wr✓ri✓it✓te✓e(✓(3✓3)✓),✓, f✓fo✓op✓pe✓en✓n(✓(3✓3)✓),✓,  g✓ge✓et✓tc✓c(✓(3✓3)✓),✓,  g✓ge✓et✓ts✓s(✓(3✓3)✓),✓,  p✓pu✓ut✓tc✓c(✓(3✓3)✓),✓,
  48.        p✓pu✓ut✓ts✓s(✓(3✓3)✓),✓, p✓pr✓ri✓in✓nt✓tf✓f(✓(3✓3)✓),✓, s✓sc✓ca✓an✓nf✓f(✓(3✓3)✓)
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. MiNT docs 0.1              3 March 1993                         1
  65.  
  66.  
  67.